package com.design.pattern.decorator;

/**
 * 使用工厂获取装饰类 FactoryGateway
 */
public class FactoryGateway {

    public static LoansComponent getGatewayComponent() {

        //todo 孙子(爸爸(爷爷()))
        //通过super执行具体的被装饰类，再反向从装饰类开始执行… （反向流程）
        return new CDecorator(new BDecorator(new BasicLoansComponent()));
    }
}
